From: Chong Yidong Date: Wed, 4 Apr 2007 15:34:43 +0000 (+0000) Subject: * subr.el (with-case-table): New macro. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~1137 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=0a4ba7be848d93e7221a30c83486df36873b9a5c;p=emacs.git * subr.el (with-case-table): New macro. --- diff --git a/lisp/subr.el b/lisp/subr.el index 4cc2a34c1c9..1a49ae6c73e 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -2480,6 +2480,16 @@ in BODY." (let ((combine-after-change-calls t)) . ,body) (combine-after-change-execute))) + +(defmacro with-case-table (table &rest body) + "Execute the forms in BODY with TABLE as the current case table. +The value returned is the value of the last form in BODY." + (declare (indent 1) (debug t)) + `(let ((old-case-table (current-case-table))) + (unwind-protect + (progn (set-case-table ,table) + ,@body) + (set-case-table old-case-table)))) ;;;; Constructing completion tables.